﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<TITLE> <? echo $title;?> </TITLE>
<base href="<?php echo base_url() ?>" />
<LINK href="images/default_1.css" type="text/css" rel=stylesheet>
<SCRIPT src="js/jquery.min.js" type="text/javascript"></SCRIPT>
<script src="js/jquery.form.js" type="text/javascript"></script>
<SCRIPT type="text/javascript">
 function readThis(){
   var tempStr = "";
   var filePath= $("#upfile").val();
   $(":input") .attr('disabled',true);
   var oXL = new ActiveXObject("Excel.application");
   var oWB = oXL.Workbooks.open(filePath);
   oWB.worksheets(1).select();
   var oSheet = oWB.ActiveSheet;
   try{
     for(var i=2;i<3000;i++){
     if(oSheet.Cells(i,1).value.toString()=="undefined" || oSheet.Cells(i,2).value.toString() =="" )
      break;
     tempStr=("  "+oSheet.Cells(i,1).value+
    "  "+oSheet.Cells(i,2).value+
    "  "+oSheet.Cells(i,3).value+
    "  "+oSheet.Cells(i,4).value+
    "  "+oSheet.Cells(i,5).value+
    "  "+oSheet.Cells(i,6).value+
     "  "+oSheet.Cells(i,7).value+
    "  "+oSheet.Cells(i,8).value+
    "  "+oSheet.Cells(i,9).value+
    "  "+oSheet.Cells(i,10).value+
    "  "+oSheet.Cells(i,11).value+
    "  "+oSheet.Cells(i,12).value+"\n\n");
    var tmp1= $("#txtArea").val();
     $("#txtArea").val(tempStr+tmp1);
    }
    
   }catch(e){
    $(":input") .attr('disabled', false);
  }
   oXL.Quit();
   CollectGarbage()
   alert("基站数据导入完成！")
    $(":input") .attr('disabled', false);
}

</SCRIPT>
</HEAD>
<BODY topMargin=10>
<TABLE cellSpacing=6 cellPadding=2 width="100%" border=0>
  <TBODY>
  <TR>
    <TD>
      <TABLE class=guide cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR>
          <TD><A href="<?php echo site_url("admin/info"); ?>" target="main">系统首页</A>&nbsp;» 基站数据导入</TD>
        </TR></TBODY></TABLE>
      <BR>
       <FORM id="myform" name="myform" method="post">
        <table class="tableborder" width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr class="header">
          <td colspan="2">基站数据导入</td>
        </tr>
        <tr>
          <td width="100">请选择文件：            </td>
          <td><input type="file" id="upfile"  size="80"/>
          </td>
        </tr>
         <tr>
          <td width="100">读取的数据：            </td>
          <td><textarea id="txtArea" cols=130 rows=15 readonly></textarea>
          </td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td><input type="button" onclick="readThis();" value="开始导入">&nbsp;&nbsp;&nbsp;&nbsp;
            <input id="reset" type="reset" value="清除选择" name="reset">
          </td>
        </tr>
        <tr>
          <td></td>
          <td > 
          <div id="msgs" style="margin-top:12px;margin-bottom:5px;font-size:13px;color: #C62E25;font-weight:bold;"></div>
          </td>
       </tr>
      </table>
      </FORM></TD></TR></TBODY></TABLE><BR><BR>
      <br/><br/>
      <DIV class=footer>
        <HR width="80%" color=#9db3c5 noShade SIZE=0>
         Powered by <? echo $copyright ?> <em>,</em><B><A style="COLOR: #666" href="<? echo base_url() ?>" target="_blank"><? echo $version;?>.</A></B>
      </DIV>
</BODY></HTML>
